/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "PAISES")
public class Paises implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "COD_PAIS")
    private Integer codPais;
    @Basic(optional = false)
    @Column(name = "NOME_PAIS")
    private String nomePais;

    public Paises() {
    }

    public Paises(Integer codPais) {
        this.codPais = codPais;
    }

    public Paises(Integer codPais, String nomePais) {
        this.codPais = codPais;
        this.nomePais = nomePais;
    }

    public Integer getCodPais() {
        return codPais;
    }

    public void setCodPais(Integer codPais) {
        Integer oldCodPais = this.codPais;
        this.codPais = codPais;
        changeSupport.firePropertyChange("codPais", oldCodPais, codPais);
    }

    public String getNomePais() {
        return nomePais;
    }

    public void setNomePais(String nomePais) {
        String oldNomePais = this.nomePais;
        this.nomePais = nomePais;
        changeSupport.firePropertyChange("nomePais", oldNomePais, nomePais);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codPais != null ? codPais.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Paises)) {
            return false;
        }
        Paises other = (Paises) object;
        if ((this.codPais == null && other.codPais != null) || (this.codPais != null && !this.codPais.equals(other.codPais))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.apagar.Paises[ codPais=" + codPais + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
